﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace HPP.UnitTest
{
    internal static class XmlAssert
    {
        public static XDocument AssertValid(string xmlString)
        {
            bool flagParseSuccess = true;
            XDocument doc = null;

            try
            {
                doc = XDocument.Parse(xmlString);
            }
            catch (Exception ex)
            {

                flagParseSuccess = false;
            }

            Assert.AreEqual(true, flagParseSuccess);
            return doc;
        }
    }
}
